/*
 * Copyright (c) 2022  by Junzhao
 * THIS FILE IS PART OF JAVASE Song Huongkang PROJECT
 * All Rights Reserved.
 */

package 动态代理.回顾静态代理;

/**
 * @Description
 * @Author 俊昭
 * @Date 2022/5/11
 */ //代理类
public class ProxyClothFactory implements ClothFactory {
    private ClothFactory factory;// 用被代理类进行实例化

    public ProxyClothFactory(ClothFactory factory) {
        this.factory = factory;
    }

    @Override
    public void produceCloth() {
        System.out.println("代理工厂准备");

        factory.produceCloth();// 这里调用的是被代理类的方法

        System.out.println("代理工厂做后续的事");
    }
}
